// 导入封装的网络请求模块
import request from '@/utils/request'
// 查询企业部门列表
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 获取简单员工信息
export function getEmloyeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}
/**
 * @description 新增部门
 * @param {*} data
 * @returns
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
/**
 * @description 根据id查询部门详情
 * @param {*} data
 * @returns
 */
export function addDepartDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

/**
 * @description 根据id修改部门详情
 * @param {*} data
 * @returns
 */
export function editDepartDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

/**
 * @description 根据id删除部门详情
 * @param {*} data
 * @returns
 */
export function delEmployee(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
